package com.lz.football.module.activity.festival
{
	import com.common.utils.Reflection;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.activity.vip.VipVo;
	
	import common.BaseView.BaseView;
	
	import flash.display.Sprite;
	
	import lz.controls.ScrollPolicy;
	import lz.controls.containers.ScrollPane;

	/**
	 *节日礼包的每日奖励 
	 * @author Administrator
	 * 
	 */	
	public class FestivalDailyView extends BaseView
	{
		
		/**
		 *滚动条 
		 */
		private var _scroll:ScrollPane;
		/**
		 *滚动条容器 
		 */
		private var _scrollContain:Sprite;
		public function FestivalDailyView()
		{
			super();
		}
		override public function initUI(view:Object=null):void
		{
			symbolSkin = Reflection.createInstance("com.lz.modul.festival.dailyView");
			this.addChild(symbolSkin);
			_windowBg = symbolSkin.dailyBg;
			_viewHeight = _windowBg.height;
			_viewWidth = _windowBg.width;
			isCloseBtn = true;
			isDrag = true;
			moveClose(_viewWidth - 30,25);
			onResizeHandler();
			initScroll();
			setDate();
		}
		/**
		 *初始化流动条 
		 * 
		 */
		private function initScroll():void
		{
			_scrollContain = new Sprite();
			_scroll = new ScrollPane();
			_scroll.horizontalScrollPolicy = ScrollPolicy.OFF;
			_scroll.setSize(510,278);
			this.addChild(_scroll);
			_scroll.x = 13;
			_scroll.y = 95;
			_scroll.update();
			
		}
		private function setDate():void
		{
			var Lv:int = AppData.getInstance().clubDatamanager.clubInfo.VIP;
			var vipVo:VipVo ;
			var item:FestivalItem;
			
			for(var i:int = 0;i < 13;i++)
			{
				item = new FestivalItem();
				item.initUI();
				vipVo = AppData.getInstance().activityDatemanager.getActivityVipVo(i);
				item.setDate(vipVo);
				item.y = (item.height+ 2) * i;
				_scrollContain.addChild(item);
			}
			_scroll.source = _scrollContain;
			_scroll.update();
		}
		override public function removeEvtListener():void
		{
			
		}
		override public function addEvtListener():void
		{
			
		}
		override public function destroyView():void
		{
			_scroll.destroy();
			_scroll = null;
			removeEvtListener();
			super.destroyView();
			
		}
	}
}